package com.guchenbo.scala.c5

import scala.collection.mutable.ListBuffer

/**
 * @author guchenbo
 * @date 2022/3/17
 */
object ListDemo {

  def main(args: Array[String]): Unit = {
    var li = List(1, 2, 3)
    val li2 = List.empty[Int]


    println(li(1))
    println(li2)
    var li3 = li :+ 2
    var li4 = 2 +: li3
    println(li3)
    println(li4)



    val lb = ListBuffer(1, 2, 3)
    val lb2 = new ListBuffer[Int]()
    println(lb)
    println(lb2)
  }
}
